import request from '@/utils/request'

/**
 * 获取搜索建议
 * @param {string} q  搜索关键词 
 * @returns 
 */

export const getSuggestionsAPI = (q) => {
    return request({
        url: '/v1_0/suggestion',
        params: {
            q
        }
    })
}


/**
 * 
 * @param {*} q 
 * @param {*} page 
 * @param {*} per_page 
 * @returns 
 */

export const getResultsAPI = (q,page, per_page) => {
    return request({
        url: '/v1_0/search',
        params: {
            q , page,per_page
        }
    })
}